$(() => {
      $.ajax({
        method: "GET",
        url: "/my/users/userinfo",
        success: function (res) {
          // console.log(res)
          if(res.status !== 0) {
            console.log("获取用户信息失败！")
          } else{
            renderUserInfo(res.data)
          }
        },
      });

      function renderUserInfo(user) {
        var {userId, username, user_pic, signature} = user
        if (user_pic !== null) {
           $(".user_pic").attr("src", user_pic).show();
        }
        $(".userInfo").attr("data-userId", userId)
      }

      $(".exit").on('click', () => {
        localStorage.removeItem("token");
      })


})